/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package exif_to_kml;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;

public class FileTableModel extends AbstractTableModel
{
    private EXIF_Reader eReader;
   public FileTableModel()
   {

   }

  
   public FileTableModel(Object[][] data,EXIF_Reader nReader)
   {
	values = data;
        eReader=nReader;
   }
    @Override
   public void setValueAt(Object value, int row, int col) {
        values[row][col] = value;
    }
    @Override
   public boolean isCellEditable(int row, int col)
   {
       if (col == 0)
       {
           if (eReader.hasGpsInfo(row))
           {
               return true;
           }
           else
           {
               return false;
           }
       }
       else
           return false;
      
   }
   public int getColumnCount()
   {
	  return columnNames.length;
   }

   public int getRowCount()
   {
	  return values.length;
   }

    @Override
   public String getColumnName(int col)
   {
	  return columnNames[col];
    }

   public Object getValueAt(int row, int col)
   {
	  return values[row][col];
   }
  
    @Override
   public Class getColumnClass(int columnIndex)
   {
        return types [columnIndex];
   }
   public String getXceptInfo()
    {
       return exceptionInfo;
   }
   

   private String exceptionInfo = "";
   protected Object values[][];
   private String[] columnNames = { "Export", "File", "Location", "Details" };
   private  Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.String.class, java.lang.String.class
                        , java.lang.String.class};
}

